package com.project.model.common;


import com.fasterxml.jackson.annotation.JsonProperty;
import org.apache.commons.lang.builder.CompareToBuilder;

/**
 * 用于排序的类
 */
public abstract class OrderEntity extends BaseEntity implements Comparable<OrderEntity> {

    private static final long serialVersionUID = 67386729551370309L;

    //排序
    private Integer orders;

    public int compareTo(OrderEntity o) {
        return new CompareToBuilder().append(getOrders(), o.getOrders()).append(getId(), o.getId()).toComparison();
    }

    @JsonProperty
    public Integer getOrders() {
        return orders;
    }

    public void setOrders(Integer orders) {
        this.orders = orders;
    }
}
